package main

import (
	"fgo/advance/other/discovery/bilibili/example/cmd/client/job"
	"fgo/advance/other/discovery/bilibili/example/conf"
	"flag"
	"github.com/bilibili/discovery/naming"
	resolver "github.com/bilibili/discovery/naming/grpc"
)

// 服务发现部分可以参考 : discovery/register_test.go
// 将 discovery 配置参数, httpServer.timeout 设置的短一些可以方便测试,但是生产环境可能会有问题(自动剔除问题)
func main() {
	flag.Parse()
	if err := conf.Init(); err != nil {
		panic(err)
	}
	// register discovery
	dis := naming.New(conf.Conf.Discovery)
	resolver.Register(dis)

	// job
	j := job.New(conf.Conf)
	// 模拟发送数据
	go j.Send()
	select {}
}
